FROM openjdk:8-jre-alpine AS release
MAINTAINER FuneralObjects <funeral_objects@qq.com>
#改用国内大陆地址
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk --no-cache add expect \
 && apk --no-cache add bash \
 && wget --no-cache https://gitee.com/FuneralObjects/HentaiAtHome-Docker/raw/master/client/HentaiAtHome.jar \
 && wget --no-cache https://gitee.com/FuneralObjects/HentaiAtHome-Docker/raw/master/start.sh \
 && wget --no-cache https://gitee.com/FuneralObjects/HentaiAtHome-Docker/raw/master/start2.sh \
 && mkdir -p /h_at_h \
 && mkdir -p /h_at_h/data \
 && mkdir -p /h_at_h/download \
 && mkdir -p /h_at_h/cache \
 && mkdir -p /h_at_h/log \
 && chmod +x start.sh \
 && chmod +x start2.sh \
 && mv start.sh /h_at_h \
 && mv start2.sh /h_at_h \
 && mv HentaiAtHome.jar /h_at_h
WORKDIR /h_at_h 
VOLUME /h_at_h/data
VOLUME /h_at_h/download
VOLUME /h_at_h/cache
VOLUME /h_at_h/log
ENTRYPOINT bash ./start.sh $H_CLIENT_ID $H_CLIENT_KEY